<?php

namespace Patrol\Controller;

use Think\Controller;

class DeviceListCodeController extends Controller {

    public function index($securityData) {
        $token['userAccount'] = \Tool\Token::getToken($securityData->token);
        $equipment = M('equipment')->field('equ_id,name,place')->select();
            if ($equipment) {
            $data['result'] = true;
            $data['message'] = "success";
            $data['devices'] = $equipment;
        } else {
            $data['result'] = false;
            $data['message'] = "fail";
        }
        echo json_encode($data, JSON_UNESCAPED_UNICODE);
    }

}
